package com.shenma2009.controller;

import com.shenma2009.domain.ResultResponse;
import com.shenma2009.service.TbProductSkuService;
import com.shenma2009.vo.IdVo;
import com.shenma2009.vo.PageVo;
import com.shenma2009.vo.TbProductSkuVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 军哥
 * @version 1.0
 * @description: TbProductSkuController
 * @date 2023/4/21 16:01
 */

@RestController
@Slf4j
@RequestMapping(value = "/sku")
public class TbProductSkuController {
    @Autowired
    TbProductSkuService tbProductSkuService;

    @PostMapping(value = "/add")
    public ResultResponse add(@RequestBody TbProductSkuVo tbProductSkuVo) {
        return tbProductSkuService.add(tbProductSkuVo);

    }

    @PostMapping(value = "/del")
    public ResultResponse del(@RequestBody IdVo idVo) {
        return tbProductSkuService.del(idVo);
    }

    @PostMapping(value = "/set")
    public ResultResponse set(@RequestBody TbProductSkuVo tbProductSkuVo) {
        return tbProductSkuService.set(tbProductSkuVo);
    }

    @PostMapping(value = "/get")
    public ResultResponse get(@RequestBody IdVo idVo) {
        return tbProductSkuService.get(idVo);
    }

    @PostMapping(value = "/list")
    public ResultResponse list(@RequestBody PageVo pageVo) {
        return tbProductSkuService.listByPage(pageVo);
    }
}
